package com.ly.web.controller.erp;

import com.ly.common.annotation.Log;
import com.ly.common.core.domain.AjaxResult;
import com.ly.common.enums.BusinessType;
import com.ly.heart.domain.KingReimburseLevelSettingEntity;
import com.ly.heart.domain.dto.KingReimburseLevelSettingDto;
import com.ly.heart.service.IKingReimburseLevelSettingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 员工报销级别设置 前端控制器
 * </p>
 * @author WuZH
 * @since 2024-08-18
 */
@Api (value = "KingReimburseLevelSetting", tags = "员工报销级别设置")
@RestController
@RequestMapping ("/KingReimburseLevelSetting")
public class KingReimburseLevelSettingController {

    @Resource
    private IKingReimburseLevelSettingService iKingReimburseLevelSettingService;

    @PreAuthorize ("@ss.hasPermi('heart:KingReimburseLevelSetting:list')")
    @GetMapping ("/list")
    @ApiOperation ("员工报销级别设置列表")
    public AjaxResult list (KingReimburseLevelSettingEntity kingReimburseLevelSettingEntity) {
        return AjaxResult.success ();
    }

    @PreAuthorize ("@ss.hasPermi('heart:KingReimburseLevelSetting:query')")
    @GetMapping (value = "/{id}")
    @ApiOperation ("获取员工报销级别设置详细信息")
    public AjaxResult getInfo (@PathVariable ("id") String id) {
        return AjaxResult.success ();
    }

    @PreAuthorize ("@ss.hasPermi('heart:KingReimburseLevelSetting:add')")
    @Log (title = "暂存员工报销级别设置", businessType = BusinessType.INSERT)
    @PostMapping ("draft")
    @ApiOperation ("暂存员工报销级别设置")
    public AjaxResult draft (@RequestBody KingReimburseLevelSettingDto kingReimburseLevelSettingDto) {
        AjaxResult draft = iKingReimburseLevelSettingService.draft ( kingReimburseLevelSettingDto );
        return draft;
    }

    @PreAuthorize ("@ss.hasPermi('heart:KingReimburseLevelSetting:add')")
    @Log (title = "提交员工报销级别设置", businessType = BusinessType.INSERT)
    @PostMapping ("submit")
    @ApiOperation ("提交员工报销级别设置")
    public AjaxResult submit (@RequestBody KingReimburseLevelSettingEntity kingReimburseLevelSettingEntity) {
        AjaxResult submit = iKingReimburseLevelSettingService.submit ( kingReimburseLevelSettingEntity );
        return submit;
    }

    @PreAuthorize ("@ss.hasPermi('heart:KingReimburseLevelSetting:edit')")
    @Log (title = "修改员工报销级别设置", businessType = BusinessType.UPDATE)
    @PutMapping
    @ApiOperation ("修改员工报销级别设置")
    public AjaxResult updateSingle (@RequestBody KingReimburseLevelSettingDto kingReimburseLevelSettingDto) {
        AjaxResult submit = iKingReimburseLevelSettingService.updateSingle ( kingReimburseLevelSettingDto );
        return submit;
    }

    @PreAuthorize ("@ss.hasPermi('heart:KingReimburseLevelSetting:remove')")
    @Log (title = "删除员工报销级别设置", businessType = BusinessType.DELETE)
    @DeleteMapping ("/{ids}")
    @ApiOperation ("删除员工报销级别设置")
    public AjaxResult deleteSingle (@PathVariable String[] ids) {
        AjaxResult submit = iKingReimburseLevelSettingService.deleteSingle ( ids );
        return submit;
    }

    @PreAuthorize ("@ss.hasPermi('heart:KingReimburseLevelSetting:remove')")
    @Log (title = "禁用员工报销级别设置")
    @RequestMapping ("disabled")
    @ApiOperation ("禁用员工报销级别设置")
    public AjaxResult disabled (String id) {
        AjaxResult submit = iKingReimburseLevelSettingService.disabled ( id );
        return submit;
    }

}
